# Contributor: John Proctor <jproctor@prium.net>
# Maintainer: juergen <juergen@archlinux.org>

pkgname=ecl
pkgver=21.2.1
# Remember to rebuild sagemath when the soname changes
pkgrel=1
pkgdesc="Embeddable Common Lisp"
arch=('x86_64')
url="https://common-lisp.net/project/ecl/"
license=('LGPL')
depends=('bash' 'gmp')
makedepends=('texinfo')
provides=('common-lisp' 'cl-asdf')
options=('!makeflags')
source=("https://common-lisp.net/project/ecl/static/files/release/${pkgname}-${pkgver}.tgz")
sha256sums=('b15a75dcf84b8f62e68720ccab1393f9611c078fcd3afdd639a1086cad010900')

build() {
  cd $pkgname-$pkgver
  sed -i 's|-Wl,--rpath,~A|-Wl,--rpath,/usr/lib/ecl|' src/configure
  CFLAGS+=" -fcommon"
  ./configure \
    --build=$CHOST \
    --prefix=/usr \
    --with-tcp \
    --with-serve-event \
    --with-clos-streams \
    --with-system-gmp \
    --without-x \
    --without-clx \
    --enable-threads \
    --enable-shared \
    --enable-boehm=included \

  make
}

package() {
  make -C $pkgname-$pkgver DESTDIR="$pkgdir" install
}
